package cn.wolfcode.p2p.base.domain;

import lombok.Getter;
import lombok.Setter;

import java.util.Date;

@Setter
@Getter
public class IpLog extends BaseDomain {
    public static final Integer STATE_FAILURE = 0; //登录失败
    public static final Integer STATE_SUCCESS = 1; //登录成功
    public static final Integer USERTYPE_WEB = 0; //前台登录类型
    public static final Integer USERTYPE_MGR = 1; //后台登录类型
    private String ip;

    private Integer state; //默认登陆失败 0

    private String username;

    private Date loginTime;

    private Integer userType; //用户类型,来判断前台还是后台登录

    public String getStateName() {
        return this.state == STATE_SUCCESS ? "登录成功" : "登录失败";
    }
    public String getuserTypeName() {
        return this.userType == USERTYPE_MGR ? "后台登录" : "前台登录";
    }
}